<script type="text/javascript">
  function show() {
      document.title = confirm("test") ? "ok" : "cancel";
  }
</script>
<button id="b" onclick="show()">show confirm</button>
